From bcd4f3ef97ed4f4aea857022dc7c69c9f2eb024a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 11 Jan 2007 19:21:53 +0000 Subject: [PATCH] (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, block/unblock SIGIO. --- src/alloc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index f3ca3e71a29..926d2706e8f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -127,21 +127,21 @@ extern __malloc_size_t __malloc_extra_blocks; static pthread_mutex_t alloc_mutex; -#define BLOCK_INPUT_ALLOC \ - do \ - { \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ - pthread_mutex_lock (&alloc_mutex); \ - } \ +#define BLOCK_INPUT_ALLOC \ + do \ + { \ + if (pthread_equal (pthread_self (), main_thread)) \ + sigblock (sigmask (SIGIO)); \ + pthread_mutex_lock (&alloc_mutex); \ + } \ while (0) -#define UNBLOCK_INPUT_ALLOC \ - do \ - { \ - pthread_mutex_unlock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - } \ +#define UNBLOCK_INPUT_ALLOC \ + do \ + { \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_equal (pthread_self (), main_thread)) \ + sigunblock (sigmask (SIGIO)); \ + } \ while (0) #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ -- 2.30.2